/*
 *  VortEdge.cpp
 *  VortPan
 *
 *  Created by Gregor Veble on 6/30/10.
 *  Copyright 2010  . All rights reserved.
 *
 */

#include "VortEdge.h"

using namespace VortPan;

VortEdge::VortEdge(VortPointReference PR1, VortPointReference PR2) : PointRef1(PR1), PointRef2(PR2), Direction(true) {
	if (PointRef1>PointRef2) {
		VortPointReference Temp(PointRef1);
		PointRef1=PointRef2;
		PointRef2=Temp;
		Direction=false;
	}
}

VortEdge::~VortEdge(){
}

bool VortEdge::operator==(const VortEdge& Other) const{
	return ((PointRef1==Other.PointRef1)&&(PointRef2==Other.PointRef2));
}

bool VortEdge::operator<(const VortEdge& Other) const{
	if (PointRef1<Other.PointRef1) {
		return true;
	} else {
		if (PointRef1>Other.PointRef1) {
			return false;
		} else {
			if (PointRef2<Other.PointRef2) {
				return true;
			} else {
				if (PointRef2>Other.PointRef2) {
					return false;
				} else {
					return false;
				}
				
			}
			
		}
	}
}

bool VortEdge::operator>(const VortEdge& Other) const{
	if (PointRef1>Other.PointRef1) {
		return true;
	} else {
		if (PointRef1<Other.PointRef1) {
			return false;
		} else {
			if (PointRef2>Other.PointRef2) {
				return true;
			} else {
				if (PointRef2<Other.PointRef2) {
					return false;
				} else {
					return false;
				}
				
			}
			
		}
	}
}
